package com.wash.shoes.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 货架状态枚举
 */
@Getter
@RequiredArgsConstructor
@AllArgsConstructor
public enum FactoryShelvesStatusEnum {


    ONLINE("ONLINE", "上架"), OFFLINE("OFFLINE", "下架");
    @EnumValue
    private String code;
    @JsonValue
    private String desc;

    @JsonCreator
    public static FactoryShelvesStatusEnum getByCode(String code) {
        for (FactoryShelvesStatusEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
